package cn.edu.nwafu.hjpg.service.impl;

import cn.edu.nwafu.hjpg.dao.JkwhbDao;
import cn.edu.nwafu.hjpg.entity.Hjxwb;
import cn.edu.nwafu.hjpg.entity.Jkwhb;
import cn.edu.nwafu.hjpg.service.JkwhbService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JkwhbServiceImpl implements JkwhbService {
    final JkwhbDao jkwhbDao;

    public JkwhbServiceImpl(JkwhbDao jkwhbDao) {this.jkwhbDao = jkwhbDao;}




    @Override
    public Page<?> findAddRecordJkwhb(String flag, Pageable pageable) {return jkwhbDao.findAllByflag(flag,pageable);}

    @Override
    public String addupdateFlag(Jkwhb jkwhb) {return jkwhbDao.save(jkwhb).getId();}

    @Override
    public void deladdRecordjkwhb(Jkwhb jkwhb) { jkwhbDao.delete(jkwhb);}

    @Override
    public String updateJkwhb(Jkwhb jkwhb) {
        return jkwhbDao.save(jkwhb).getId();
    }

    @Override
    public String addJkwhfl(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addJkjxdx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addJpjxdx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addXrjxdx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addMxjkdx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addMxjpdx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addMxxrdx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addZax(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addRfc(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addRfd(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addJksf(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addXriur(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addYysyz(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addZtbx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addSzdx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addSjdx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addPfzm(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addHxzm(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addFscjx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addLxbxxx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addQtdlxxx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addJkdddlx(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public String addJkwhxxbz(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getId();
    }

    @Override
    public List<Jkwhb> findByIdAndFlagInJkwhb(String id, String name, String flag) {

        return jkwhbDao.findElementByBaseinfoWzbmAndAttributeAndFlag(id,name,flag);
    }
    @Override
    public String addElement(Jkwhb jkwhb) {
        return jkwhbDao.insert(jkwhb).getBaseinfoWzbm();
    }

    @Override
    public Page<?> findByPageJkwhb(String id,String attribute, int flag, Pageable pageable) {
        return jkwhbDao.findAllByflagAndAttribute(id,attribute,flag,pageable);
    }

    @Override
    public List<Jkwhb> findAllByBaseinfoWzbmAndFlag(String id, String flag) {
        return  jkwhbDao.findAllByBaseinfoWzbmAndFlag(id,flag);
    }



    @Override
    public List<Jkwhb> findAll() {
        return jkwhbDao.findAll();
    }
}
